<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Enterprise staff management System Login</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css"
	href="themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="themes/icon.css">
<link rel="stylesheet" type="text/css" href="themes/color.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="bootstrap/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/easyui-lang-zh_CN.js"></script>

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css">
<script src="bootstrap/js/bootstrap.min.js"></script>

<style type="text/css">
#smt {
	margin-top: 80px;
}

#win {
	
}
</style>
<script type="text/javascript">
	$(function() {
		$("#win").window({
			width : 500,
			height : 400,
			modal : true,
			maximizable : false,
			title : "企业员工管理系统登录窗口"
		});
		$("#uname").textbox({
			iconCls : "icon-man",
			iconAlign : "right",
			required : true,
			missingmessage : "请输入用户名...",
			height : 35,
		})
		$("#upsw").textbox({
			iconCls : "icon-lock",
			iconAlign : "right",
			required : true,
			height : 35,
		})

		//配置登录表单
		$("#loginform").form({
			//发起请求
			url : "userLogin",
			dataType : "json",
			data : {
				uname : $("#uname").val(),
				upsw : $("#upsw").val()
			},
			type : "post",
			success : function(flag) {
				var b = eval("(" + flag + ")");
				if (b.flag) {
					location.href = "main.jsp";
					$("#win").window("close");
				} else {
					$("#s1").text("用户不存在！");
					$("#loginform").form("clear");
				}
			}
		});
	});
</script>
</head>
<body>
	<div id="win">
		<form id="loginform" method="post">
			<div id="smt" align="center">
				<h2>
					<span id="s1" style="color: #F00"></span>
				</h2>
				<br /> <input id="uname" name="uname" type="text"
					style="width: 300px"><br /> <br /> <input id="upsw"
					name="upsw" type="password" style="width: 300px"><br /> <br />
				<button id="btn" type="submit" class="btn btn-success btn-lg"
					style="width: 150px; height: 40px;">登录</button>
			</div>
		</form>
	</div>
</body>


</html>